Skip to content

fix: decode path flag before writing it to form - #934

Merged
mshanemc merged 1 commit into
mainfrom
cd/fix-encoded-url
Jan 16, 2024
Merged

fix: decode path flag before writing it to form#934
mshanemc merged 1 commit into
mainfrom
cd/fix-encoded-url

Conversation

@cristiand391

@cristiand391 cristiand391 commented Jan 16, 2024

Copy link
Copy Markdown
Contributor

What does this PR do?

Follow up from #913

sf org open --path <path> isn't working on current nightly (sf v2.25.5).

Screenshot 2024-01-16 at 12 14 04

--path is URI-encoded by default (for the old behavior of opening the url with the AT + path | source-file as param), but the form redirect requires is to be decoded:

Screenshot 2024-01-16 at 12 15 19

tested on macos (firefox/chrome) and windows (firefox/edge)

What issues does this PR fix or reference?

[skip-validate-pr]

Comment thread src/commands/org/open.ts
conn.instanceUrl,
// the path flag is URI-encoded in its `parse` func.
// For the form redirect to work we need it decoded.
flags.path ? decodeURIComponent(flags.path) : retUrl

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retUrl can be either a generated path from --source-file or --path.
If the former that's fine because it doesn't get encoded in generateFileUrl, so we only check for flags.path.

@mshanemc
mshanemc merged commit c7009fb into main Jan 16, 2024
@mshanemc
mshanemc deleted the cd/fix-encoded-url branch January 16, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants